package 补充.输入输出操作.文件操作;

import java.io.*;

public class 数据流 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("D:\\Learn\\javademo\\untitled\\src\\补充_偏\\输入输出操作\\read.txt");
        DataOutputStream dos = new DataOutputStream(fos);
        dos.write(10);
        dos.writeChar('c');
        dos.writeBoolean(true);
        dos.writeUTF("健健康康");
        dos.close();
        FileInputStream fis=new FileInputStream("D:\\Learn\\javademo\\untitled\\src\\补充_偏\\输入输出操作\\read.txt");
        DataInputStream dis=new DataInputStream(fis);
        System.out.println(dis.readInt());
        System.out.println(dis.readChar());
        System.out.println(dis.readBoolean());
        System.out.println(dis.readUTF());
        dis.close();
    }
}
